package cn.qu.phizline.event.login;

import cn.qu.phizline.event.Body;
import cn.qu.phizline.event.Payload;


/**
 * 登录  代码2
 */
public class LoginEvent extends Payload {

    private static final int TYPE = 2;
    private static final int VERSION = 1;

    @Override
    public int getType() {
        return TYPE;
    }

    @Override
    public int getVersion() {
        return VERSION;
    }

    @Override
    public Class<? extends Body> getBodyType() {
        return LoginBody.class;
    }

    public static class LoginBody implements Body {
        private String token;
        private String user;
        private String passwd;

        public String getToken() {
            return token;
        }

        public void setToken(String token) {
            this.token = token;
        }

        public String getUser() {
            return user;
        }

        public void setUser(String user) {
            this.user = user;
        }

        public String getPasswd() {
            return passwd;
        }

        public void setPasswd(String passwd) {
            this.passwd = passwd;
        }
    }

    /**
     * 无此用户
     */
    public static final int CODE_NO_USER = 2001;
    /**
     * 登录成功
     */
    public static final int CODE_LOGIN_SUCCESS = 2000;
}
